home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kit PC World De Ampliacion De Windows 95
/
Kit PC World de ampliacion de Windows 95.iso
/
clarion
/
cw15
/
examp15.z
/
GRAPHVBX.CLW
< prev
next >
Wrap
Text File
|
1995-09-05
|
28KB
|
877 lines
! VBX Custom Control Demonstration Program
! Requires GRAPH.VBX and GSW.EXE supplied with Visual Basic (from Microsoft)
! NB This program is not written with style in mind, as it is
! purely intended as a demonstration OF some OF the capabilities
! OF the CW system, and not as a teaching example.
TestGraph PROGRAM
INCLUDE('Equates.CLW')
MAP
Initialise
PieGraph
BarGraph
GanttGraph
OtherGraphs
END
ColorQueue QUEUE,PRE(COL)
ColorName STRING(13)
END
FNameQueue QUEUE,PRE(FNM)
FontName STRING(6)
END
GPieStyleQueue QUEUE,PRE(STY)
PieStyleString STRING(35)
END
GBarStyleQueue QUEUE,PRE(STY)
BarStyleString STRING(30)
END
GGanttStyleQueue QUEUE,PRE(STY)
GanttStyleString STRING(13)
END
MainWin APPLICATION('VBX Custom Control Test'),AT(31,8,240,101),ICON('WINPYR.ICO'),HLP('About'),STATUS, |
SYSTEM
MENUBAR
MENU('&File'),HLP('FILE_MENU'),MSG('File menu')
ITEM('&Pie Charts'),USE(?PieGraph),MSG('Demonstrate Pie Charts')
ITEM('&Bar Graphs'),USE(?BarGraph),MSG('Demonstrate Bar Charts')
ITEM('&Gantt Charts'),USE(?GanttGraph),MSG('Demonstrate Gantt Charts')
ITEM('&Other Types'),USE(?FileOtherTypes)
ITEM,SEPARATOR
ITEM('E&xit'),USE(?MainExit),MSG('Quit Graph VBX Testing')
END
MENU('&Help'),USE(?Help)
ITEM('&Contents'),USE(?Contents)
END
END
END
CODE
HELP('Graph.hlp')
Initialise
OPEN(MainWin)
ACCEPT
CASE EVENT()
OF Event:ACCEPTED
CASE ACCEPTED()
OF ?PieGraph
PieGraph()
OF ?BarGraph
BarGraph()
OF ?GanttGraph
GanttGraph()
OF ?FileOtherTypes
OtherGraphs
OF ?Contents
HELP
OF ?MainExit
BREAK
. . .
CLOSE(MainWin)
FREE(ColorQueue)
FREE(FNameQueue)
FREE(GPieStyleQueue)
FREE(GBarStyleQueue)
FREE(GGanttStyleQueue)
Initialise PROCEDURE
ColorString STRING(208)
Color STRING(13),Dim(16),Over(ColorString)
CODE
ColorString = 'Black Blue Green Cyan '& |
'Red Magenta Brown Light Gray '& |
'Dark Gray Light Blue Light Green Light Cyan '& |
'Light Red Light MagentaYellow White '
LOOP zx# = 1 TO 16
COL:ColorName = COLOR[zx#]
ADD(ColorQueue)
END
FNM:FontName = 'Roman'; ADD(FNameQueue)
FNM:FontName = 'Swiss'; ADD(FNameQueue)
FNM:FontName = 'Modern'; ADD(FNameQueue)
STY:PieStyleString = 'Default'; ADD(GPieStyleQueue)
STY:PieStyleString = 'No label lines'; ADD(GPieStyleQueue)
STY:PieStyleString = 'Colored labels'; ADD(GPieStyleQueue)
STY:PieStyleString = 'Colored labels without lines'; ADD(GPieStyleQueue)
STY:PieStyleString = '% Labels'; ADD(GPieStyleQueue)
STY:PieStyleString = '% Labels without lines'; ADD(GPieStyleQueue)
STY:PieStyleString = '% Colored labels'; ADD(GPieStyleQueue)
STY:PieStyleString = '% Colored labels without lines'; ADD(GPieStyleQueue)
STY:BarStyleString = 'Default'; ADD(GBarStyleQueue)
STY:BarStyleString = 'Horizontal'; ADD(GBarStyleQueue)
STY:BarStyleString = 'Stacked'; ADD(GBarStyleQueue)
STY:BarStyleString = 'Horizontal stacked'; ADD(GBarStyleQueue)
STY:BarStyleString = 'Stacked %'; ADD(GBarStyleQueue)
STY:BarStyleString = 'Horizontal stacked %'; ADD(GBarStyleQueue)
STY:BarStyleString = 'Z-clustered (3D)'; ADD(GBarStyleQueue)
STY:BarStyleString = 'Horizontal Z-clustered (3D)'; ADD(GBarStyleQueue)
STY:GanttStyleString = 'Default'; ADD(GGanttStyleQueue)
STY:GanttStyleString = 'Spaced bars'; ADD(GGanttStyleQueue)
PieGraph PROCEDURE
Title STRING(50)
BackColor STRING(13)
GraphType STRING(7)
LeftTitle STRING(80)
BottomTitle STRING(80)
FontSize SHORT
FontFamily BYTE
Italic BYTE
Bold BYTE
Underline BYTE
Palette STRING(15)
PieType STRING(7)
GraphStyle STRING(35)
Exploded BYTE
Legend BYTE
NumPoints SHORT
PointNum SHORT
Color STRING(13)
Pattern SHORT
ExplPoint BYTE
LabelText STRING(20)
LegendText STRING(20)
GStyle SHORT
ColorNum SHORT
Value SHORT
Ret BYTE
PieScreen WINDOW('Pie Charts Demonstration'),AT(,,315,215),STATUS,SYSTEM,GRAY,DOUBLE
CUSTOM('Graph'),AT(150,30,150,130),USE(?Graph),CLASS('Graph.VBX','Graph'),'MousePointer'('3')
STRING('Font Style:'),AT(7,49),USE(?String2),TRN
STRING('Y-Axis Title:'),AT(87,69),USE(?String6),TRN
BUTTON('E&xit'),AT(260,196,30,15),USE(?Exit)
BUTTON('&Refresh Graph'),AT(193,196,57,15),USE(?Display)
LIST,AT(7,31,74,10),FONT('Arial',8,,),MSG('Select Background Colour'),USE(BackColor),FORMAT('80L'), |
DROP(16),FROM(ColorQueue)
LIST,AT(6,61,74,10),FONT('Arial',8,,),MSG('Select Font Family'),USE(FontFamily),FORMAT('80L'), |
DROP(3),FROM(FNameQueue)
STRING('Graph Style:'),AT(7,84),USE(?String3),TRN
LIST,AT(7,93,74,10),FONT('Arial',8,,),MSG('Select Graph Style'),USE(GraphStyle),FORMAT('80L'), |
DROP(8),FROM(GPieStyleQueue)
ENTRY(@n3),AT(97,27,29,12),MSG('Enter Font Size'),USE(FontSize),LEFT,OVR
ENTRY(@s80),AT(97,53,29,12),MSG('Enter X-Axis title'),USE(BottomTitle),LEFT,OVR
ENTRY(@s80),AT(97,80,29,12),MSG('Enter Y-Axis title'),USE(LeftTitle),LEFT,OVR
ENTRY(@S50),AT(150,8,150,12),FONT('Modern',12,,),USE(Title),SKIP,DISABLE,CENTER,INS
STRING('Background:'),AT(6,21),USE(?String1),TRN
STRING('X-Axis Title:'),AT(88,42),USE(?String5),TRN
OPTION('Coloring'),AT(8,154,60,55),USE(Palette),BOXED
RADIO('Solid color'),AT(15,166,51,10),USE(?Solid),RIGHT
RADIO('Pastel'),AT(15,177,48,10),USE(?Pastel),RIGHT
RADIO('Grayscale'),AT(15,188,49,10),USE(?GrayScale),RIGHT
END
GROUP('Text Style'),AT(74,153,60,55),BOXED
CHECK('Italics'),AT(81,165,33,10),USE(Italic),RIGHT
CHECK('Bold'),AT(81,178,26,10),USE(Bold),RIGHT
CHECK('Underline'),AT(81,190,44,10),USE(Underline),RIGHT
END
OPTION,AT(6,1,75,19),MSG('Select Pie Type'),USE(PieType),BOXED
RADIO('2D Pie'),AT(8,7,31,10),USE(?2DPie),RIGHT
RADIO('3D Pie'),AT(46,7,31,10),USE(?3DPie),RIGHT
END
STRING('Font Size:'),AT(93,17),USE(?String4),TRN
GROUP('Pie Style'),AT(8,111,60,33),BOXED
CHECK('Exploded'),AT(15,120,43,10),USE(Exploded),RIGHT
CHECK('Legend'),AT(15,132,41,10),USE(Legend),RIGHT
END
GROUP('No. OF Points'),AT(74,111,60,33),BOXED
ENTRY(@n20),AT(80,125,49,12),USE(NumPoints),RIGHT,OVR
END
BUTTON('Specify Points'),AT(90,95,52,15),USE(?SpecPoints)
END
SpecPoint WINDOW('Specify Point Properties'),AT(93,39,130,129),CENTER,GRAY,DOUBLE
STRING('Point No :'),AT(18,6,32,10),LEFT
ENTRY(@n3),AT(65,5,19,11),USE(PointNum),DISABLE,RIGHT,INS
STRING('Color :'),AT(29,23,21,10),LEFT
LIST,AT(59,22,60,10),FONT('Arial',8,,),MSG('Select Color'),USE(Color),FORMAT('80L'),DROP(16),FROM(ColorQueue)
STRING('Legend Text :'),AT(6,36,44,10),LEFT
ENTRY(@s20),AT(59,35,60,10),USE(LegendText),LEFT
STRING('Label Text :'),AT(12,50,38,10),LEFT
ENTRY(@s20),AT(59,49,60,10),USE(LabelText),LEFT
STRING('Pattern :'),AT(23,63,28,10),LEFT
ENTRY(@n3),AT(59,62,60,10),USE(Pattern),RIGHT,INS
STRING('Value :'),AT(28,77,22,10),LEFT
ENTRY(@n5),AT(59,75,60,10),USE(Value),RIGHT,OVR
CHECK('Exploded '),AT(24,90,43,10),USE(ExplPoint),LEFT
BUTTON('Cancel'),AT(25,105,34,14),USE(?Cancel)
BUTTON('OK'),AT(69,105,34,14),USE(?OKButton),DEFAULT
END
CODE
BackColor = 'Light Gray'
BottomTitle = 'X-Axis'
LeftTitle = 'Y'
FontFamily = 'Roman'; FontSize = 100;
Italic = 0; Bold = 0; Underline = 0
Palette = 'Solid color'
PieType = '2D Pie'
GraphStyle = 'Default'
OPEN(PieScreen)
Title = ?Graph{'CtlVersion'}
?Graph{ 'LeftTitle' } = LeftTitle
?Graph{ 'BottomTitle' } = BottomTitle
?Graph{ 'FontUse' } = 4
?Graph{ 'Background' } = 7
?Graph{ 'GraphType' } = 1
NumPoints = ?Graph{'NumPoints'}
DO ShowGraph !for 32-bit compatibility
ACCEPT
CASE EVENT()
OF Event:ACCEPTED
CASE FIELD()
OF ?BackColor
?Graph{ 'Background' } = Choice()-1
OF ?FontFamily
?Graph{ 'FontFamily' } = Choice()-1
OF ?GraphStyle
?Graph{ 'GraphStyle' } = Choice()-1
OF ?FontSize
?Graph{ 'FontSize' } = FontSize
OF ?BottomTitle
?Graph{ 'BottomTitle' } = BottomTitle
OF ?LeftTitle
?Graph{ 'LeftTitle' } = LeftTitle
OF ?PieType
EXECUTE CHOICE()
?Graph { 'GraphType' } = 1
?Graph { 'GraphType' } = 2
END
OF ?Palette
EXECUTE CHOICE()
?Graph { 'Palette' } = 0
?Graph { 'Palette' } = 1
?Graph { 'Palette' } = 2
END
OF ?Italic orof ?Bold orof ?Underline
?Graph { 'FontStyle' } = BXor(?Graph{ 'FontStyle'}, 2^(Field()-?Italic))
OF ?NumPoints
?Graph { 'NumPoints' } = NumPoints
OF ?SpecPoints
?Graph { 'AutoInc' } = 0
GStyle = ?Graph{ 'GraphStyle'}
LOOP PointNum=1 TO NumPoints
?Graph { 'ThisPoint' } = PointNum
ColorNum = ?Graph{ 'ColorData'}
GET(ColorQueue, ColorNum+1)
Color = COL:ColorName
Value = ?Graph{ 'GraphData'}
Pattern = ?Graph{ 'PatternData'}
LabelText = ?Graph{ 'LabelText'}
ExplPoint = ?Graph{ 'ExtraData'}
LegendText = ?Graph{ 'LegendText'}
DO SpecifyPoint
IF Ret
?Graph { 'GraphData' } = Value
?Graph { 'PatternData' } = Pattern
?Graph { 'ColorData' } = ColorNum
?Graph { 'LabelText' } = LabelText
?Graph { 'ExtraData' } = ExplPoint
?Graph { 'LegendText' } = LegendText
END
END
OF ?Display
Do ShowGraph
OF ?Exit
BREAK
. . .
Close(PieScreen)
SpecifyPoint ROUTINE
OPEN(SpecPoint)
IF NOT Legend
DISABLE(?LegendText)
ELSE
ENABLE(?LegendText)
END
IF NOT Exploded
DISABLE(?ExplPoint)
ELSE
ENABLE(?ExplPoint)
END
IF GStyle < 1 OR GStyle > 3
DISABLE(?LabelText)
ELSE
ENABLE(?LabelText)
END
DISPLAY
ACCEPT
CASE Accepted()
OF ?Color
ColorNum = Choice()-1
OF ?OKButton
Ret = 1
BREAK
OF ?Cancel
Ret = 0
BREAK
END
END
CLOSE(SpecPoint)
ShowGraph ROUTINE
?Graph { 'DrawMode' } = 2
BarGraph PROCEDURE
Title STRING(50)
BackColor STRING(13)
GraphType STRING(7)
LeftTitle STRING(80)
BottomTitle STRING(80)
FontSize SHORT
FontFamily BYTE
Italic BYTE
Bold BYTE
Underline BYTE
Palette STRING(15)
BarType STRING(7)
GraphStyle STRING(35)
Legend BYTE
Labels BYTE
NumPoints SHORT
NumSets SHORT
PointNum SHORT
SetNum SHORT
ForeColor STRING(13)
SideColor STRING(13)
Pattern SHORT
LabelText STRING(20)
LegendText STRING(20)
GStyle SHORT
ForeColorNum SHORT
SideColorNum SHORT
Value SHORT
Ret BYTE
PointSet STRING(10)
Choice SHORT
BarScreen WINDOW('Bar Charts Demonstration'),AT(,,315,215),STATUS,SYSTEM,GRAY,DOUBLE
CUSTOM('Graph'),AT(150,30,150,130),USE(?Graph),CLASS('Graph.VBX','Graph')
BUTTON('E&xit'),AT(260,196,30,15),USE(?Exit)
BUTTON('&Refresh Display'),AT(191,196,60,15),USE(?Display)
LIST,AT(6,36,74,10),FONT('Arial',8,,),MSG('Select Background Colour'),USE(BackColor),FORMAT('80L'), |
DROP(16),FROM(ColorQueue)
STRING('X-Axis Title:'),AT(104,36),USE(?String4),TRN
LIST,AT(6,59,74,10),FONT('Arial',8,,),MSG('Select Font Family'),USE(FontFamily),FORMAT('80L'), |
DROP(3),FROM(FNameQueue)
STRING('Y-Axis Title:'),AT(104,64),USE(?String5),TRN
STRING('Graph Style:'),AT(7,71),USE(?String8),TRN
LIST,AT(7,82,74,10),FONT('Arial',8,,),MSG('Select Graph Style'),USE(GraphStyle),FORMAT('80L'), |
DROP(8),FROM(GBarStyleQueue)
ENTRY(@n3),AT(104,18,29,12),MSG('Enter Font Size'),USE(FontSize),LEFT,OVR
STRING('Background Color:'),AT(6,25),USE(?String6),TRN
ENTRY(@s80),AT(104,47,29,12),MSG('Enter X-Axis title'),USE(BottomTitle),LEFT,OVR
STRING('Font Type:'),AT(6,48),USE(?String7),TRN
ENTRY(@s80),AT(104,76,29,12),MSG('Enter Y-Axis title'),USE(LeftTitle),LEFT,OVR
ENTRY(@S50),AT(150,8,150,12),FONT('Modern',12,,),USE(Title),SKIP,DISABLE,CENTER,INS
OPTION('Coloring'),AT(8,156,60,55),USE(Palette),BOXED
RADIO('Solid color'),AT(15,168,51,10),USE(?Solid),RIGHT
RADIO('Pastel'),AT(15,179,48,10),USE(?Pastel),RIGHT
RADIO('Grayscale'),AT(15,190,49,10),USE(?GrayScale),RIGHT
END
GROUP('Text Style'),AT(74,156,60,55),BOXED
CHECK('Italics'),AT(81,167,33,10),USE(Italic),RIGHT
CHECK('Bold'),AT(81,180,26,10),USE(Bold),RIGHT
CHECK('Underline'),AT(81,192,44,10),USE(Underline),RIGHT
END
OPTION,AT(6,4,75,19),MSG('Select Bar Type'),USE(BarType),BOXED
RADIO('2D Bar'),AT(8,11,31,10),USE(?2DBar),RIGHT
RADIO('3D Bar'),AT(44,11,31,10),USE(?3DBar),RIGHT
END
STRING('Font Size:'),AT(104,6),USE(?String3),TRN
GROUP('Bar Style'),AT(8,113,60,39),BOXED
CHECK('Legend'),AT(15,136,41,10),TIP('Enables Legend entry in Specify Points option'),USE(Legend), |
RIGHT
CHECK('Labels'),AT(15,125,34,10),TIP('Enables Label entry in Specify Points option'),USE(Labels), |
RIGHT
END
GROUP('No OF'),AT(74,113,60,39),BOXED
ENTRY(@n20),AT(109,124,20,10),USE(NumPoints),RIGHT,OVR
ENTRY(@n20),AT(109,137,20,10),USE(NumSets),RIGHT,OVR
STRING('Points :'),AT(80,126,25,10),LEFT
STRING('Sets :'),AT(80,136,19,10),LEFT
END
BUTTON('Specify Points'),AT(84,96,53,14),USE(?SpecPoints)
END
SpecPoint WINDOW('Specify Point Properties'),AT(93,39,130,129),CENTER,GRAY,DOUBLE
STRING('Point / Set No :'),AT(4,7,48,10),RIGHT
ENTRY(@s10),AT(62,5,31,11),USE(PointSet),SKIP,RIGHT,INS
STRING('Front Color :'),AT(8,21,45,10),RIGHT
LIST,AT(62,19,60,10),FONT('Arial',8,,),MSG('Select Color'),USE(ForeColor),FORMAT('80L'),DROP(16), |
FROM(ColorQueue)
STRING('Side Color :'),AT(14,35,38,10),RIGHT
LIST,AT(62,33,60,10),FONT('Arial',8,,),MSG('Select Color'),USE(SideColor),FORMAT('80L'),DROP(16), |
FROM(ColorQueue)
STRING('Legend Text :'),AT(8,49,44,10),RIGHT
ENTRY(@s20),AT(62,47,60,10),USE(LegendText),LEFT,INS
STRING('Label Text :'),AT(14,63,38,10),RIGHT
ENTRY(@s20),AT(62,61,60,10),USE(LabelText),LEFT,INS
STRING('Pattern :'),AT(24,77,28,10),RIGHT
ENTRY(@n3),AT(62,75,60,10),USE(Pattern),RIGHT,INS
STRING('Value :'),AT(30,93,22,10),RIGHT
ENTRY(@n5),AT(62,91,60,10),USE(Value),RIGHT,OVR
BUTTON('Cancel'),AT(25,105,34,14),USE(?Cancel)
BUTTON('OK'),AT(69,105,34,14),USE(?OKButton),DEFAULT
END
CODE
BackColor = 'Light Gray'
BottomTitle = 'X-Axis'
LeftTitle = 'Y'
FontFamily = 'Roman'; FontSize = 100;
Italic = 0; Bold = 0; Underline = 0
Palette = 'Solid color'
BarType = '2D Bar'
GraphStyle = 'Default'
OPEN(BarScreen)
Title = ?Graph{ 'CtlVersion'}
?Graph { 'LeftTitle' } = LeftTitle
?Graph { 'BottomTitle' } = BottomTitle
?Graph { 'FontUse' } = 4
?Graph { 'Background' } = 7
?Graph { 'GraphType' } = 3
NumPoints = ?Graph{ 'NumPoints'}
NumSets = ?Graph{ 'NumSets'}
DO ShowGraph
ACCEPT
CASE EVENT()
OF Event:ACCEPTED
CASE FIELD()
OF ?BackColor
?Graph { 'Background' } = CHOICE()-1
OF ?FontFamily
?Graph { 'FontFamily' } = CHOICE()-1
OF ?GraphStyle
Choice = CHOICE()-1
?Graph { 'GraphStyle' } = Choice
IF Choice >= 6
BarType = '3D Bar'
?Graph { 'GraphType' } = 4
END
OF ?FontSize
?Graph { 'FontSize' } = FontSize
OF ?BottomTitle
?Graph { 'BottomTitle' } = BottomTitle
OF ?LeftTitle
?Graph { 'LeftTitle' } = LeftTitle
OF ?Palette
EXECUTE CHOICE()
?Graph { 'Palette' } = 0
?Graph { 'Palette' } = 1
?Graph { 'Palette' } = 2
END
OF ?Italic orof ?Bold orof ?Underline
?Graph { 'FontStyle' } = BXor(?Graph{ 'FontStyle'}, 2^(Field()-?Italic))
OF ?BarType
EXECUTE CHOICE()
?Graph { 'GraphType' } = 3
?Graph { 'GraphType' } = 4
END
OF ?NumPoints
?Graph { 'NumPoints' } = NumPoints
OF ?NumSets
?Graph { 'NumSets' } = NumSets
OF ?SpecPoints
?Graph { 'AutoInc' } = 0
LOOP SetNum=1 TO NumSets
?Graph { 'ThisSet' } = SetNum
LOOP PointNum=1 TO NumPoints
?Graph { 'ThisPoint' } = PointNum
ForeColorNum = ?Graph{ 'ColorData'}
SideColorNum = ?Graph{ 'ExtraData'}
GET(ColorQueue, ForeColorNum+1)
ForeColor = COL:ColorName
GET(ColorQueue, SideColorNum+1)
SideColor = COL:ColorName
Value = ?Graph{ 'GraphData'}
Pattern = ?Graph{ 'PatternData'}
LabelText = ?Graph{ 'LabelText'}
LegendText = ?Graph{ 'LegendText'}
DO SpecifyPoint
IF Ret
?Graph { 'GraphData' } = Value
?Graph { 'PatternData' } = Pattern
?Graph { 'ColorData' } = ForeColorNum
?Graph { 'ExtraData' } = SideColorNum
?Graph { 'LabelText' } = LabelText
?Graph { 'LegendText' } = LegendText
END
END
END
OF ?Display
Do ShowGraph
OF ?Exit
BREAK
. . .
CLOSE(BarScreen)
SpecifyPoint ROUTINE
PointSet = PointNum &' / ' & SetNum
DISPLAY(?PointSet)
OPEN(SpecPoint)
IF NOT Legend
DISABLE(?LegendText)
END
IF NOT Labels
DISABLE(?LabelText)
END
DISPLAY
ACCEPT
CASE Accepted()
OF ?ForeColor
ForeColorNum = Choice()-1
OF ?SideColor
SideColorNum = Choice()-1
OF ?OKButton
Ret = 1
BREAK
OF ?Cancel
Ret = 0
BREAK
END
END
CLOSE(SpecPoint)
ShowGraph ROUTINE
?Graph { 'DrawMode' } = 2
GanttGraph PROCEDURE
Title STRING(50)
BackColor STRING(13)
GraphType STRING(7)
LeftTitle STRING(80)
BottomTitle STRING(80)
FontSize SHORT
FontFamily BYTE
Italic BYTE
Bold BYTE
Underline BYTE
Palette STRING(15)
GraphStyle STRING(35)
Legend BYTE
Labels BYTE
NumPoints SHORT
NumSets SHORT
PointNum SHORT
SetNum SHORT
ForeColor STRING(13)
Pattern SHORT
LabelText STRING(20)
LegendText STRING(20)
GStyle SHORT
ForeColorNum SHORT
Value SHORT
Ret BYTE
PointSet STRING(10)
Choice SHORT
GanttScreen WINDOW('Gantt Charts Demonstration'),AT(,,315,215),STATUS,SYSTEM,GRAY,DOUBLE
STRING('Background Color:'),AT(8,6),USE(?String3)
STRING('Font Size:'),AT(103,7),USE(?String6)
CUSTOM('Graph'),AT(150,30,150,130),USE(?Graph),CLASS('Graph.VBX','Graph')
STRING('X-Axis Title:'),AT(104,37),USE(?String7)
STRING('Font Type:'),AT(7,38),USE(?String4)
BUTTON('E&xit'),AT(260,196,30,15),USE(?Exit)
BUTTON('Refresh &Display'),AT(191,196,59,15),USE(?Display)
LIST,AT(7,18,74,10),FONT('Arial',8,,),MSG('Select Background Colour'),USE(BackColor),FORMAT('80L'), |
DROP(16),FROM(ColorQueue)
LIST,AT(7,49,74,10),FONT('Arial',8,,),MSG('Select Font Family'),USE(FontFamily),FORMAT('80L'), |
DROP(3),FROM(FNameQueue)
STRING('Y-Axis Title:'),AT(104,67),USE(?String8)
STRING('Graph Style:'),AT(7,68),USE(?String5)
LIST,AT(7,80,74,10),FONT('Arial',8,,),MSG('Select Graph Style'),USE(GraphStyle),FORMAT('80L'), |
DROP(2),FROM(GGanttStyleQueue)
ENTRY(@n3),AT(103,18,29,12),MSG('Enter Font Size'),USE(FontSize),LEFT,OVR
ENTRY(@s80),AT(103,48,29,12),MSG('Enter X-Axis title'),USE(BottomTitle),LEFT,OVR
ENTRY(@s80),AT(103,79,29,12),MSG('Enter Y-Axis title'),USE(LeftTitle),LEFT,OVR
ENTRY(@S50),AT(150,8,150,12),FONT('Modern',12,,),USE(Title),SKIP,CENTER,INS
OPTION('Coloring'),AT(7,154,60,55),USE(Palette),BOXED
RADIO('Solid color'),AT(14,166,51,10),USE(?Solid),RIGHT
RADIO('Pastel'),AT(14,177,48,10),USE(?Pastel),RIGHT
RADIO('Grayscale'),AT(14,188,49,10),USE(?GrayScale),RIGHT
END
GROUP('Text Style'),AT(73,154,60,55),BOXED
CHECK('Italics'),AT(80,165,33,10),USE(Italic),RIGHT
CHECK('Bold'),AT(80,178,26,10),USE(Bold),RIGHT
CHECK('Underline'),AT(80,190,44,10),USE(Underline),RIGHT
END
GROUP('Gantt Style'),AT(7,111,60,39),BOXED
CHECK('Legend'),AT(14,134,41,10),TIP('Enable Legend entry in Specify Points option'),USE(Legend), |
RIGHT
CHECK('Labels'),AT(14,123,34,10),TIP('Enable Labels entry in Specify Points option'),USE(Labels), |
RIGHT
END
GROUP('No OF'),AT(73,111,60,39),BOXED
ENTRY(@n20),AT(108,122,20,10),USE(NumPoints),RIGHT,OVR
ENTRY(@n20),AT(108,135,20,10),USE(NumSets),RIGHT,OVR
STRING('Points :'),AT(79,124,25,10),LEFT
STRING('Sets :'),AT(79,134,19,10),LEFT
END
BUTTON('Specify Points'),AT(86,94,52,15),USE(?SpecPoints)
END
SpecPoint WINDOW('Specify Point Properties'),AT(93,39,130,129),CENTER,GRAY,DOUBLE
BUTTON('Cancel'),AT(25,105,34,14),USE(?Cancel)
BUTTON('OK'),AT(69,105,34,14),USE(?OKButton),DEFAULT
STRING('Point / Set No :'),AT(4,7,48,10),RIGHT
ENTRY(@s10),AT(62,5,31,11),USE(PointSet),SKIP,RIGHT,INS
ENTRY(@n3),AT(62,62,60,10),USE(Pattern),RIGHT,INS
STRING('Pattern :'),AT(24,64,28,10),RIGHT
LIST,AT(62,19,60,10),FONT('Arial',8,00H),MSG('Select Color'),USE(ForeColor),FORMAT('80L'),DROP(16),FROM(ColorQueue)
STRING('Color :'),AT(12,21,38,10),RIGHT
STRING('Legend Text :'),AT(8,36,44,10),RIGHT
STRING('Label Text :'),AT(14,50,38,10),RIGHT
ENTRY(@s20),AT(62,34,60,10),USE(LegendText),LEFT,INS
ENTRY(@s20),AT(62,48,60,10),USE(LabelText),LEFT,INS
STRING('Value :'),AT(30,80,22,10),RIGHT
ENTRY(@n5),AT(62,78,60,10),USE(Value),RIGHT,OVR
END
CODE
BackColor = 'Light Gray'
BottomTitle = 'X-Axis'
LeftTitle = 'Y'
FontFamily = 'Roman'; FontSize = 100;
Italic = 0; Bold = 0; Underline = 0
Palette = 'Solid color'
GraphStyle = 'Default'
OPEN(GanttScreen)
Title = ?Graph{ 'CtlVersion'}
?Graph { 'LeftTitle' } = LeftTitle
?Graph { 'BottomTitle' } = BottomTitle
?Graph { 'FontUse' } = 4
?Graph { 'Background' } = 7
?Graph { 'GraphType' } = 5
NumPoints = ?Graph{ 'NumPoints'}
NumSets = ?Graph{ 'NumSets'}
DO ShowGraph
ACCEPT
CASE EVENT()
OF Event:ACCEPTED
CASE FIELD()
OF ?BackColor
?Graph { 'Background' } = CHOICE()-1
OF ?FontFamily
?Graph { 'FontFamily' } = CHOICE()-1
OF ?GraphStyle
?Graph { 'GraphStyle' } = CHOICE()-1
OF ?FontSize
?Graph { 'FontSize' } = FontSize
OF ?BottomTitle
?Graph { 'BottomTitle' } = BottomTitle
OF ?LeftTitle
?Graph { 'LeftTitle' } = LeftTitle
OF ?Palette
EXECUTE CHOICE()
?Graph { 'Palette' } = 0
?Graph { 'Palette' } = 1
?Graph { 'Palette' } = 2
END
OF ?Italic OROF ?Bold OROF ?Underline
?Graph { 'FontStyle' } = BXOR(?Graph{ 'FontStyle'}, 2^(FIELD()-?Italic))
OF ?NumPoints
?Graph { 'NumPoints' } = NumPoints
OF ?NumSets
?Graph { 'NumSets' } = NumSets
OF ?SpecPoints
?Graph { 'AutoInc' } = 0
LOOP SetNum=1 TO NumSets
?Graph { 'ThisSet' } = SetNum
LOOP PointNum=1 TO NumPoints
?Graph { 'ThisPoint' } = PointNum
ForeColorNum = ?Graph{ 'ColorData'}
GET(ColorQueue, ForeColorNum+1)
ForeColor = COL:ColorName
Value = ?Graph{ 'GraphData'}
Pattern = ?Graph{ 'PatternData'}
LabelText = ?Graph{ 'LabelText'}
LegendText = ?Graph{ 'LegendText'}
DO SpecifyPoint
IF Ret
?Graph { 'GraphData' } = Value
?Graph { 'PatternData' } = Pattern
?Graph { 'ColorData' } = ForeColorNum
?Graph { 'LabelText' } = LabelText
?Graph { 'LegendText' } = LegendText
END
END
END
OF ?Display
DO ShowGraph
OF ?Exit
BREAK
. . .
Close(GanttScreen)
SpecifyPoint ROUTINE
PointSet = PointNum &' / ' & SetNum
DISPLAY(?PointSet)
OPEN(SpecPoint)
IF NOT Legend
DISABLE(?LegendText)
END
IF NOT Labels
DISABLE(?LabelText)
END
IF SetNum = 1
DISABLE(?LabelText)
DISABLE(?LegendText)
END
DISPLAY
ACCEPT
CASE ACCEPTED()
OF ?ForeColor
ForeColorNum = CHOICE()-1
OF ?OKButton
Ret = 1
BREAK
OF ?Cancel
Ret = 0
BREAK
END
END
CLOSE(SpecPoint)
ShowGraph ROUTINE
?Graph { 'DrawMode' } = 2
OtherGraphs PROCEDURE
window WINDOW('Other Graph Types Available'),AT(,,185,92),CENTER,GRAY
STRING('The Chart Builder GRAPH.VBX also provides support'),AT(7,7),USE(?String1)
STRING('for line, Log/Lin, Polar, Area, Scatter, and High-Low-'),AT(7,21),USE(?String2)
STRING('Close types. Please consult the Chart Builder help'),AT(7,35),USE(?String3)
STRING('for more information.'),AT(7,50),USE(?String4)
BUTTON('OK'),AT(75,75,35,14),USE(?OkButton),DEFAULT
END
CODE
OPEN(window)
ACCEPT
CASE EVENT()
OF Event:Accepted
CASE FIELD()
OF ?OkButton
BREAK
END
END
END
CLOSE(window)